#define _USE_MATH_DEFINES

#include <jni.h>
#include <cmath>

#include "Circle.h"

JNIEXPORT jfloat JNICALL Java_Circle_calculateArea(JNIEnv *env, jobject obj) {
	jclass cls = env->GetObjectClass(obj);
	jfieldID fid = env->GetFieldID(cls, "radius", "F");
	jfloat radius = env->GetFloatField(obj, fid);

	return M_PI * pow(radius, 2.0);
}
